<template>
  <div class="page chat-index">
    <div class="content">
      <div class="content-box">
        <div class="content-box-inner">
          <mp-button
            type="default"
            size="large"
            btnClass="btn"
            @click="onRobotServiceClick">
            <div class="btn-inner bg-blue">
              <p class="title">智能客服</p>
              <p class="intro">24 hours online</p>
              <i class="icon icon-kefu-1"></i>
            </div>
          </mp-button>
        </div>
      </div>
      <div class="content-box">
        <div class="content-box-inner">
          <mp-button
            type="default"
            size="large"
            btnClass="btn"
            open-type="contact">
            <div class="btn-inner bg-cyan">
              <p class="title">人工客服</p>
              <p class="intro">Artificial service</p>
              <i class="icon icon-kefu-2"></i>
            </div>
          </mp-button>
        </div>
      </div>
      <div class="content-box">
        <div class="content-box-inner">
          <mp-button
            type="default"
            size="large"
            btnClass="btn"
            @click="onExpressInquiryClick">
            <div class="btn-inner bg-olive">
              <p class="title">快递查询</p>
              <p class="intro">Express inquiry</p>
              <i class="icon icon-express"></i>
            </div>
          </mp-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import mpButton from 'mpvue-weui/src/button'

export default {
  components: {
    mpButton
  },
  data () {
    return {
    }
  },
  methods: {
    onRobotServiceClick () {
      wx.navigateTo({
        url: '/pages/robot/main',
      })
    },
    onExpressInquiryClick () {
      wx.navigateTo({
        url: '/pages/express-inquiry/main',
      })
    }
  }
}
</script>

<style lang="less">
.chat-index {
  .content {
    display: flex;
    flex-wrap: wrap;
    padding: 30rpx 30rpx;
    &-box {
      width: 50%;
      margin-bottom: 30rpx;
      &:nth-child(2n+1) {
        .content-box-inner {
          padding-right: 15rpx;
        }
      }
      &:nth-child(2n) {
        .content-box-inner {
          padding-left: 15rpx;
        }
      }
      .btn {
        padding: 0;
        text-align: left;
        overflow: visible;
        &::after {
          display: none;
        }
        &-inner {
          position: relative;
          z-index: 1;
          padding: 30rpx;
          background-image: url("../../../static/images/card-bg.png");
          background-repeat: no-repeat;
          background-position: center;
          background-size: cover;
          border-radius: 12rpx;
          &.bg-cyan {
            background-color: #1cbbb4;
          }
          &.bg-blue {
            background-color: #0081ff;
          }
          &.bg-olive {
            background-color: #8dc63f;
          }
          // --red: #e54d42;
          // --orange: #f37b1d;
          // --yellow: #fbbd08;
          // --olive: #8dc63f;
          // --green: #39b54a;
          // --cyan: #1cbbb4;
          // --blue: #0081ff;
          // --purple: #6739b6;
          // --mauve: #9c26b0;
          // --pink: #e03997;
          // --brown: #a5673f;
          // --grey: #8799a3;
          // --black: #333333;
          // --darkGray: #666666;
          // --gray: #aaaaaa;
          // --ghostWhite: #f1f1f1;
          // --white: #ffffff;
          &::after {
            content: "";
            position: absolute;
            z-index: -1;
            background-color: inherit;
            width: 100%;
            height: 100%;
            left: 0;
            bottom: -10%;
            border-radius: 10rpx;
            opacity: 0.2;
            transform: scale(0.9, 0.9);
          }
        }
        &.button-hover {
          .btn-inner {
            &.bg-cyan {
              background-color: #d2f1f0;
            }
            &.bg-blue {
              background-color: #cce6ff;
            }
            &.bg-olive {
              background-color: #e8f4d9;
            }
            // --redLight: #fadbd9;
            // --orangeLight: #fde6d2;
            // --yellowLight: #fef2ce;
            // --oliveLight: #e8f4d9;
            // --greenLight: #d7f0db;
            // --cyanLight: #d2f1f0;
            // --blueLight: #cce6ff;
            // --purpleLight: #e1d7f0;
            // --mauveLight: #ebd4ef;
            // --pinkLight: #f9d7ea;
            // --brownLight: #ede1d9;
            // --greyLight: #e7ebed;
          }
        }
      }
      .icon {
        display: block;
        position: absolute;
        top: 30rpx;
        right: 30rpx;
        width: 60rpx;
        height: 60rpx;
        background-repeat: no-repeat;
        background-position: center center;
        background-size: contain;
        &.icon-kefu-1 {
          background-image: url("../../../static/images/kefu-1.png");
        }
        &.icon-kefu-2 {
          background-image: url("../../../static/images/kefu-2.png");
        }
        &.icon-express {
          background-image: url("../../../static/images/express.png");
        }
      }
      .title {
        padding: 0;
        font-size: 32rpx;
        font-weight: 300;
        color: #fff;
        line-height: 60rpx;
        &::first-letter {
          font-size: 40rpx;
        }
      }
      .intro {
        position: relative;
        font-size: 28rpx;
        color: #fff;
        &::first-letter {
          font-size: 36rpx;
          font-weight: bold;
        }
        &::before {
          content: "";
          position: absolute;
          display: block;
          width: 40rpx;
          height: 8rpx;
          background: #fff;
          bottom: 0;
          right: 0;
          opacity: 0.5;
        }
        &::after {
          content: "";
          position: absolute;
          display: block;
          width: 100rpx;
          height: 4rpx;
          background: #fff;
          bottom: 0;
          right: 40rpx;
          opacity: 0.3;
        }
      }
    }
  }
}
</style>
